package com.example.demofeign.controller;

import com.example.democommon.domain.user.User;
import com.example.demofeign.internal.FeignInternalUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Auther Created by l.wang on 2019/2/27.
 */
@RestController
public class FeignController {

    @Autowired
    private FeignInternalUser feignInternalUser;

    @GetMapping("/feign/getUser")
    public String getUser(){
        return feignInternalUser.getUser("123");
    }

    @GetMapping("/feign/getUserList")
    public List<User> getUserList(){
        User user = new User().setAge("12").setSex("男").setUserName("wangliang");
        return feignInternalUser.getUsers(user);
    }
}
